<admintpl file="header" />
<style>
	.center {
		text-align: center!important;
	}
	.show_video_info {
		margin-left: 20px;
		padding: 5px 10px;
		border: 1px transparent;
		border-radius: 10px;
		background-color: #ffac15;
	}
</style>
</head>
<body>
<div class="wrap js-check-wrap">
	<ul class="nav nav-tabs">
		<li><a href="{:U('Lesson/Adminvideo/video_lists')}" target="_self">视频列表</a></li>
		<li class="active"><a href="javascript:;">添加视频</a></li>
	</ul>

	<form action="{:U('Lesson/Adminvideo/upload_online_video')}" method="post" class="form-horizontal js-ajax-forms" enctype="multipart/form-data">
		<div class="row-fluid">
			<div class="span9">
				<table class="table table-bordered">
					<tr>
						<th>云存储ID</th>
						<td>
							<input type="text" style="width: 400px;color: black;" id="video_id" name="video_id"/>
							<button class="show_video_info" type="button">确定</button>
						</td>
					</tr>
					<tr>
						<th>视频名称</th>
						<td>
							<input type="text" style="width: 400px;color: black;" id="video_name" name="video_name"/>
						</td>
					</tr>
					<tr>
						<th>视频大小</th>
						<td>
							<input type="text" style="width: 400px;color: black;" id="video_size" readonly/> （M）
						</td>
					</tr>
					<tr>
						<th>上传时间</th>
						<td>
							<input type="text" style="width: 400px;color: black;" id="created_at" readonly/>
						</td>
					</tr>
				</table>
			</div>
		</div>
		<div class="form-actions">
			<button class="btn btn-primary js-ajax-submit" type="submit">提交</button>
			<a class="btn" href="{:U('Lesson/Adminvideo/video_lists')}">返回</a>
		</div>
	</form>
</div>
<script src="__PUBLIC__/js/common.js"></script>
<script type="text/javascript" src="__PUBLIC__/js/layer/layer_1.js"></script>
<script>
    $(document).ready(function () {
        $('.show_video_info').click(function () {
            var video_id = $('#video_id').val();
            if (video_id) {
                $.get("{:U('Lesson/Adminvideo/get_video_info')}", {video_id : video_id}, function (re) {
					if (re.status) {
                        $('#video_size').val(re.video_size);
                        $('#created_at').val(re.created_at);
					} else {
					    layer.msg(re.info);
					}
                });
			}
        })
    })
</script>
</body>
</html>